<!--
 * @Author: krsea 965837746@qq.com
 * @Date: 2025-03-03 09:03:00
 * @LastEditors: krsea 965837746@qq.com
 * @LastEditTime: 2025-03-03 10:04:52
 * @FilePath: \vue3-code\2305\week3\3.组件嵌套.html
 * @Description: 
 * 
 * Copyright (c) 2025 by ${git_name_email}, All Rights Reserved. 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>组件嵌套</title>
    <!-- 引入 vue.js -->
    <script src="../js/vue.js"></script>
</head>

<body>
    <!-- div id 为 app 挂载点 -->
    <div id="app">
        <parent-component></parent-component>
    </div>

    <!-- 使用 javascript 脚本 -->
    <script type="text/javascript">

      Vue.component('parent-component', {
        components: {
            'child-component': {
                template: '<div><p>我是子组件调色板1</p><input type="color" /></div>'
            }
        },
        template: '<div><child-component></child-component></div>'
      })


      var app = new Vue({
           el: '#app' 
      })

    </script>
</body>

</html>